Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't drop cached packages when only removing packages (RhBug:2237883) #885

Merged
merged 3 commits into from
Oct 2, 2023

Conversation

jan-kolarik
Copy link
Member

@jan-kolarik jan-kolarik commented Sep 15, 2023

In order to have a easier workflow for making package caching exceptions for some commands and also to match the keepcache behavior with the original dnf in this matter, the cached files are now removed only when keepcache option is turned off at the moment.

We don't want to remove the stored packages cache after running the remove command transaction, therefore we override the keepcache option to true. This is useful for use cases when the previous transaction downloaded a large amount of data, but didn't finished correctly. Then we'd like to fix the system state by removing some problematic package. We don't want to lose our cached data in this case.

CI tests: rpm-software-management/ci-dnf-stack#1381
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2237883

In order to have a easier workflow for making package caching exceptions for some commands and also to match the `keepcache` behavior with the original dnf in this matter, the cached files are now removed only when `keepcache` option is turned off at the moment.
@jan-kolarik
Copy link
Member Author

jan-kolarik commented Sep 15, 2023

The current PR is creating an exception for the remove command to don't drop any cached packages from the disk disregarding the currently setup keepcache option. What about other related commands, like autoremove or group remove? Or do we want to configure the keeping cache behavior in general for all transactions with only package removals? In that case, we'd need to document that properly.

@j-mracek j-mracek self-assigned this Sep 18, 2023
Copy link
Contributor

@j-mracek j-mracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask you to move logic from DNF5 to LIBDNF5?

When the `keepcache` option is turned off, the packages downloaded during a previous command should still be preserved until a subsequent successful transaction that involves inbound actions such as installation or upgrading. This assumption is based on the idea that these packages were downloaded for this purpose.

As a result, temporary packages are retained even across transactions that do not involve any inbound actions.

This feature is also valuable in cases where a previous transaction downloaded a substantial amount of data but did not complete correctly. In such instances, we want to rectify the system state by removing problematic packages without losing our cached data.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2237883
@jan-kolarik jan-kolarik force-pushed the jkolarik/dont-drop-cached-packages-on-remove branch from d6895e1 to 5fdd3fe Compare September 20, 2023 12:44
@jan-kolarik jan-kolarik force-pushed the jkolarik/dont-drop-cached-packages-on-remove branch from 5fdd3fe to b4dbb55 Compare September 20, 2023 12:47
@j-mracek
Copy link
Contributor

j-mracek commented Oct 2, 2023

LGTM

@j-mracek j-mracek added this pull request to the merge queue Oct 2, 2023
Merged via the queue into main with commit 515776d Oct 2, 2023
7 checks passed
@j-mracek j-mracek deleted the jkolarik/dont-drop-cached-packages-on-remove branch October 2, 2023 09:24
@j-mracek
Copy link
Contributor

j-mracek commented Oct 2, 2023

@jan-kolarik Thank you very much for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants